<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link tag="li"
                   v-for="item of List"
                   :to="'/detail/'+item.id"
                   :key="item.id"
                   class="item border-bottom">

        <div class="item-img-wrapper">
          <img class="item-img"
               :src="item.imgUrl"
               alt="" />
        </div>
        <div class="item-info">
          <p class="item-title">
            {{ item.title }}
          </p>
          <p class="item-desc">{{ item.desc }}</p>
          <button class="item-btn">了解详情</button>
        </div>
        <!-- </router-link> -->
      </router-link>
    </ul>
    <div class="recommend-floor">查看更多</div>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  props: {
    List: Array,
  },
  data () {
    return {
    };
  },

};
</script>

<style lang="stylus" scoped>
@import '~@/assets/style/maxin.stylus';

.recommend-title {
  margin-top: 0.2rem;
  line-height: 0.8rem;
  background-color: #eee;
  text-indent: 0.2rem;
  text-align: center;
}

.recommend-floor {
  margin-top: 0.2rem;
  line-height: 0.8rem;
  background-color: #fff;
  text-indent: 0.2rem;
  text-align: center;
  color: green;
}

.item {
  display: flex;
  position: relative;
  overflow: hidden;
  height: 1.9rem;
  background-color: white;

  .item-img-wrapper {
    padding: 0.1rem;
    overflow: hidden;

    .item-img {
      display: block;
      height: 100%;
      margin: 0 auto;
      height: 1.68rem;
      width: 1.48rem;
    }
  }

  .item-info {
    flex: 1;
    padding: 0.1rem;
    min-width: 0;

    .item-title {
      color: blue;
      line-height: 0.4rem;
      font-size: 0.32rem;
      ellipsis();
    }

    .item-desc {
      line-height: 0.3rem;
      color: #ccc;
      margin-top: 0.2rem;
      margin-bottom: 0.2rem;
    }

    .item-btn {
      background-color: #ff9300;
      padding: 0.1rem;
      border-radius: 0.06rem;
      font-size: 0.2rem;
    }
  }
}
</style>